- empty_repo = @project.empty_repo?
- show_auto_devops_callout = show_auto_devops_callout?(@project)
- emails_disabled = @project.emails_disabled?

.project-home-panel.js-show-on-project-root.gl-mt-4.gl-mb-5{ class: [("empty-project" if empty_repo)] }
  .gl-display-flex.gl-justify-content-space-between.gl-flex-wrap.gl-sm-flex-direction-column.gl-mb-3.gl-gap-5
    .home-panel-title-row.gl-display-flex.gl-align-items-center
      %div{ class: 'avatar-container rect-avatar s64 home-panel-avatar gl-flex-shrink-0 gl-w-11 gl-h-11 gl-mr-3! float-none' }
        = project_icon(@project, alt: @project.name, class: 'avatar avatar-tile s64', width: 64, height: 64, itemprop: 'image')
      %div
        %h1.home-panel-title.gl-font-size-h1.gl-mt-3.gl-mb-2.gl-display-flex.gl-word-break-word{ data: { qa_selector: 'project_name_content' }, itemprop: 'name' }
          = @project.name
          = visibility_level_content(@project, css_class: 'visibility-icon gl-text-secondary gl-ml-2', icon_css_class: 'icon')
          = render_if_exists 'compliance_management/compliance_framework/compliance_framework_badge', project: @project, additional_classes: 'gl-align-self-center gl-ml-2'
          - if @project.group
            = render_if_exists 'shared/tier_badge', source: @project, source_type: 'Project'
        .home-panel-metadata.gl-font-sm.gl-text-secondary.gl-font-base.gl-font-weight-normal.gl-line-height-normal{ data: { qa_selector: 'project_id_content' }, itemprop: 'identifier' }
          - if can?(current_user, :read_project, @project)
            %span.gl-display-inline-block.gl-vertical-align-middle
              = s_('ProjectPage|Project ID: %{project_id}') % { project_id: @project.id }
              = clipboard_button(title: s_('ProjectPage|Copy project ID'), text: @project.id)
          - if current_user
            %span.gl-ml-3.gl-mb-3
              = render 'shared/members/access_request_links', source: @project

    .project-repo-buttons.gl-display-flex.gl-justify-content-md-end.gl-align-items-center.gl-flex-wrap.gl-gap-3
      - if current_user
        - if current_user.admin?
          = link_button_to nil, [:admin, @project], icon: 'admin', title: _('View project in admin area'), data: {toggle: 'tooltip', placement: 'top', container: 'body'}
        - if @notification_setting
          .js-vue-notification-dropdown{ data: { disabled: emails_disabled.to_s, dropdown_items: notification_dropdown_items(@notification_setting).to_json, notification_level: @notification_setting.level, help_page_path: help_page_path('user/profile/notifications'), project_id: @project.id, no_flip: 'true' } }

      = render 'projects/buttons/star'
      = render 'projects/buttons/fork'

  - if can?(current_user, :read_code, @project)
    %nav.project-stats
      - if @project.empty_repo?
        = render 'stat_anchor_list', anchors: @project.empty_repo_statistics_anchors
      - else
        = render 'stat_anchor_list', anchors: @project.statistics_anchors(show_auto_devops_callout: show_auto_devops_callout)
  .gl-my-3
    = render "shared/projects/topics", project: @project
  .home-panel-home-desc.mt-1
    - if @project.description.present?
      .home-panel-description.text-break
        .home-panel-description-markdown.read-more-container{ itemprop: 'description' }
          = markdown_field(@project, :description)
        %button.btn.gl-button.btn-blank.btn-link.js-read-more-trigger.d-lg-none{ type: "button" }
          = _("Read more")

    = render_if_exists "projects/home_mirror"

  - if @project.badges.present?
    .project-badges.mb-2{ data: { qa_selector: 'project_badges_content' } }
      - @project.badges.each do |badge|
        - badge_link_url = badge.rendered_link_url(@project)
        %a.gl-mr-3{ href: badge_link_url,
          target: '_blank',
          rel: 'noopener noreferrer',
          data: { qa_selector: 'badge_image_link', qa_link_url: badge_link_url } }>
          %img.project-badge{ src: badge.rendered_image_url(@project),
            'aria-hidden': true,
            alt: 'Project badge' }>
